package com.cxyxj.importdemo;

import org.springframework.context.annotation.ImportSelector;
import org.springframework.core.type.AnnotationMetadata;

import java.util.Set;


/**
 * @author: gongj
 * @create: 2022-01-25 10:46
 */
public class ImportSelectorTest implements ImportSelector {
    @Override
    public String[] selectImports(AnnotationMetadata importingClassMetadata) {
        String className = importingClassMetadata.getClassName();
        System.out.println(className);
        Set<String> annotationTypes = importingClassMetadata.getAnnotationTypes();
        annotationTypes.stream().forEach(System.out::println);
        //return new String[]{"com.cxyxj.importdemo.ImportSelectorComponent"};
        return new String[]{ImportSelectorComponent.class.getName()};
    }
}
